﻿using System;

namespace HslCommunication.Core.IMessage
{
	/// <summary>
	/// 用于欧姆龙通信的Fins协议的消息解析规则
	/// </summary>
	// Token: 0x02000155 RID: 341
	public class FinsMessage : INetMessage
	{
		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ProtocolHeadBytesLength" />
		// Token: 0x170005D3 RID: 1491
		// (get) Token: 0x06001D21 RID: 7457 RVA: 0x0008D1D0 File Offset: 0x0008B3D0
		public int ProtocolHeadBytesLength
		{
			get
			{
				return 8;
			}
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetContentLengthByHeadBytes" />
		// Token: 0x06001D22 RID: 7458 RVA: 0x0008D1D4 File Offset: 0x0008B3D4
		public int GetContentLengthByHeadBytes()
		{
			return BitConverter.ToInt32(new byte[]
			{
				this.HeadBytes[7],
				this.HeadBytes[6],
				this.HeadBytes[5],
				this.HeadBytes[4]
			}, 0);
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.CheckHeadBytesLegal(System.Byte[])" />
		// Token: 0x06001D23 RID: 7459 RVA: 0x0008D220 File Offset: 0x0008B420
		public bool CheckHeadBytesLegal(byte[] token)
		{
			bool flag = this.HeadBytes == null;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				bool flag2 = this.HeadBytes[0] == 70 && this.HeadBytes[1] == 73 && this.HeadBytes[2] == 78 && this.HeadBytes[3] == 83;
				result = flag2;
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetHeadBytesIdentity" />
		// Token: 0x06001D24 RID: 7460 RVA: 0x00047BE1 File Offset: 0x00045DE1
		public int GetHeadBytesIdentity()
		{
			return 0;
		}

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.HeadBytes" />
		// Token: 0x170005D4 RID: 1492
		// (get) Token: 0x06001D25 RID: 7461 RVA: 0x0008D27F File Offset: 0x0008B47F
		// (set) Token: 0x06001D26 RID: 7462 RVA: 0x0008D287 File Offset: 0x0008B487
		public byte[] HeadBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ContentBytes" />
		// Token: 0x170005D5 RID: 1493
		// (get) Token: 0x06001D27 RID: 7463 RVA: 0x0008D290 File Offset: 0x0008B490
		// (set) Token: 0x06001D28 RID: 7464 RVA: 0x0008D298 File Offset: 0x0008B498
		public byte[] ContentBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.SendBytes" />
		// Token: 0x170005D6 RID: 1494
		// (get) Token: 0x06001D29 RID: 7465 RVA: 0x0008D2A1 File Offset: 0x0008B4A1
		// (set) Token: 0x06001D2A RID: 7466 RVA: 0x0008D2A9 File Offset: 0x0008B4A9
		public byte[] SendBytes { get; set; }
	}
}
